﻿@using Smartstore.Web.Models.Catalog;

@model ProductSummaryItemModel

@{
    var list = Model.Parent;
    int ratingPercent = 0;
    if (Model.TotalReviews != 0)
    {
        ratingPercent = ((Model.RatingSum * 100) / Model.TotalReviews) / 5;
    }

    string reviewTitle = string.Empty;
    if (Model.TotalReviews > 0)
    {
        reviewTitle = $"{Model.TotalReviews} {(Model.TotalReviews == 1 ? T("Reviews.Overview.Review") : T("Reviews.Overview.Reviews"))}";
    }
}

<div class="art-rating" title="@reviewTitle">
    <div class="rating">
        <div style="width: @(ratingPercent)%"></div>
    </div>
</div>